import request from "../utils/request";
// 获取订单页面信息
export const reqGetTradeInfo = () => {
  return request({
    method: "GET",
    url: `/order/auth/trade`,
  });
};

//提交订单
export const reqSubmitOrder = ({
  tradeNo, // 注意接口文档参数有问题，多了一个r
  consignee,
  consigneeTel,
  deliveryAddress,
  paymentWay,
  orderComment,
  orderDetailList,
}) => {
  return request({
    method: "POST",
    url: `/order/auth/submitOrder`,
    params: {
        tradeNo
      },
      data: {
        consignee,
        consigneeTel,
        deliveryAddress,
        paymentWay,
        orderComment,
        orderDetailList
      }
  });
};
// 获取支付二维码的图片

export const reqWeixinPay = (orderId) => {
  return request({
    method: 'GET',
    url: `/payment/weixin/createNative/${orderId}`
  })
}
//获取支付状态
export const reqQueryPayStatus = (orderId) => {
  return request({
    method: 'GET',
    url: `/payment/weixin/queryPayStatus/${orderId}`
  })
}
